<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta top="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    body {
        margin: 10px;
    }

    .title {
        line-height: 40px;
        font-weight: 700;
    }

    .list .item {
        display: flex;
        /* justify-content: space-between; */
        align-items: center;
        font-size: 12px;
        margin-bottom: 10px;

    }

    .list .item img {
        width: 100px;
        border-radius: 5px;
    }

    .list .item .middle .top {
        font-weight: 700;
        font-size: 16px;
        margin-bottom: 5px;
    }

    .list .item .middle .price {
        color: red;
        margin-bottom: 5px;
        font-weight: 700;
        font-size: 16px;


    }

    .list .item .pic2 {
        width: 15px;

    }

    .list .item .middle del {
        color: red;
        font-weight: 100;
        font-size: 12px;
        color: gray;


    }

    .list .item .middle .a {
        color: gray;
        margin: 5px 0;
    }

    .list .item .middle {
        width: 300px;
        height: 100px;
        margin: 0 20px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .right button {
        background-color: orangered;
        border-radius: 15px;
        border: 0;
        padding: 5px 15px;
        color: white;

    }
    .bottom{
        display: flex;
        justify-content: space-between;

    }
    .add{
        width: 80px;
        display: flex;
        justify-content: space-between;
        font-size: 16px;
        font-weight: 700;


    }
    .jian{
        width: 20px;
        height: 20px;
        border: 2px solid rgb(73, 178, 235);
        border-radius: 50%;
        box-sizing: border-box;
        text-align: center;
        line-height:15px;
        color: rgb(73, 178, 235);

    }
    .jia{
        width: 20px;
        height: 20px;
        background-color: rgb(73, 178, 235);
        border-radius: 50%;
        text-align: center;
        color: white;
        line-height:16px;


    }
</style>

<body>
    <div id="app">
        <div class="title">热门单品</div>
        <div class="list">
            <div class="item" v-for="(item,index) in tasklist" key="index">
                <div class="left">
                    <img v-bind:src="item.pic" alt="">
                </div>
                <div class="middle">
                    <div class="top"> {{item.top}} </div>
                    <div class="bottom">
                        <div class="price"> {{item.price}} <del> {{item.b}} </del></div>
                        <div class="add">
                            <div class="jian">-</div>
                            <div class="num">1</div>
                            <div class="jia">+</div>
                        </div>
                    </div>


                </div>
                <!-- <div class="right">
                    <button>{{item.status==1?'立即兑':'不兑换'}}</button>
                </div> -->
            </div>
        </div>
    </div>

</body>

</html>
<script src="./vue-2.5.21.js"></script>
<script>
    //实例化Vue对象
    var v = new Vue({
        el: '#app',//el 表示Vue实例挂载的dom节点，id选择器
        data: {
            tasklist: [
                { id: 1, pic: './pic.png', top: '秋刀鱼/斤', price: '￥35.00', b: '￥35.00', status: 1 },
                { id: 2, pic: './pic.png', top: '鲜大带鱼/条', price: '￥45.00', b: '￥55.00', status: 1 },
                { id: 3, pic: './pic.png', top: '鲜活全母皮皮虾/斤', price: '￥35.00', b: '￥95.00', status: 1 },
            ]
        },//data 定义响应式数据，data的类型可以是对象，也可以是函数
        // data:function(){return{}} 两种写法
        computed: {},//定义计算属性
        watch: {},//定义数据监听
        methods: {},//定义方法(函数)
        filters: {},//定义过滤器
        directives: {},//定义自定义指令
        components: {},//注册局部组件
    })
    //接下来使用VueJS的声名式编程语法，实现<数据驱动试图更新>

</script>